


def makeQueryFields(kwargs, Table):
    def _get_field(slug):
        return getattr(Table, slug)

    filters = []
    for k, v in kwargs.items():
            if hasattr(Table,k):
                field = _get_field(k)
                filters.append(field == v)
    return filters